From 51dacc9fbf7785894abe3b7a0bb3eb5d8bf62258 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 14 Feb 2012 09:59:59 +0000 Subject: [PATCH] split ns selector tests for filter / disable options ping r111376 --- tests/phpunit/includes/HtmlTest.php | 48 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index 566152e4c1..c3c7646ddd 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -265,19 +265,12 @@ class HtmlTest extends MediaWikiTestCase { ), 'Basic namespace selector with custom values' ); - $immovable = array(); - $namespaces = $wgContLang->getNamespaces(); - foreach ( $namespaces as $nsId => $nsName ) { - if ( !MWNamespace::isMovable( intval( $nsId ) ) ) { - $immovable[] = $nsId; - } } - $this->assertEquals( - '' . "\n" . '' . "\n" . -'' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . @@ -286,13 +279,40 @@ class HtmlTest extends MediaWikiTestCase { '' . "\n" . '' . "\n" . '' . "\n" . -'' . "\n" . +'' . "\n" . '' . "\n" . '', Html::namespaceSelector( - array( 'exclude' => array( 100, 101 ), 'disable' => $immovable ) + array( 'exclude' => array( 0, 1, 3, 100, 101 ) ) ), - 'Namespace selector without the custom namespace and immovable namespaces disabled.' + 'Namespace selector namespace filtering.' + ); + } + + function testCanDisableANamespaces() { + $this->assertEquals( +'', + Html::namespaceSelector( array( + 'disable' => array( 0, 1, 2, 3, 4 ) + ) ), + 'Namespace selector namespace disabling' ); } -- 2.20.1